package com.budwk.app.sqfw.controllers.admin;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.budwk.app.sqfw.models.Sqfw_formSummary;
import com.budwk.app.sqfw.services.SqfwFormSummaryService;
import com.budwk.starter.common.openapi.annotation.ApiDefinition;
import com.budwk.starter.common.openapi.annotation.ApiOperation;
import com.budwk.starter.common.openapi.annotation.ApiResponses;
import com.budwk.starter.common.result.Result;
import com.budwk.starter.log.annotation.SLog;
import lombok.extern.slf4j.Slf4j;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.POST;
import org.nutz.mvc.annotation.Param;

import java.util.List;

/**
 * 辖区商铺信息
 */
@IocBean
@At("/platform/sqfw/storeInfo")
@ApiDefinition(tag = "辖区商铺信息")
@Slf4j
public class SqfwStoreInfoForAppController {

    @Inject
    private SqfwFormSummaryService sqfwFormSummaryService;


    /**
     * 根据当前登录人获取辖区商铺信息
     *
     * @return
     */
    @At("/getStoreInfo")
    @Ok("json")
    @POST
    @ApiOperation(name = "根据当前登录人获取辖区商铺信息")
    @ApiResponses
    @SLog(tag = "根据当前登录人获取辖区商铺信息", value = "")
    @SaCheckLogin
    public Result<?> getStoreInfo(@Param("status") String status,@Param("pageNo") Integer pageNo,@Param("pageSize") Integer pageSize,@Param("content") String content) {
        log.info("SqfwStoreInfoForAppController.getStoreInfo 请求参数：status：{},pageNo{},pageSize{}，content：{}",status,pageNo,pageSize,content);
        List<Sqfw_formSummary> vo = sqfwFormSummaryService.getStoreInfo(status,pageNo,pageSize,content);
        return Result.data(vo);
    }

}
